<?php /* Smarty version Smarty-3.1.18, created on 2017-09-05 15:48:02
         compiled from "/Applications/MAMP/htdocs/PHP/jifenshop/protected/template/wap/home.index.html" */ ?>
<?php /*%%SmartyHeaderCode:2929223345973479f9b8f03-36025073%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '67dfd17c84242979729e83ae6043abe878a51551' => 
    array (
      0 => '/Applications/MAMP/htdocs/PHP/jifenshop/protected/template/wap/home.index.html',
      1 => 1504597178,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '2929223345973479f9b8f03-36025073',
  'function' => 
  array (
  ),
  'version' => 'Smarty-3.1.18',
  'unifunc' => 'content_5973479fa864b2_79730870',
  'variables' => 
  array (
    'data' => 0,
    'g' => 0,
    'icon' => 0,
  ),
  'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_5973479fa864b2_79730870')) {function content_5973479fa864b2_79730870($_smarty_tpl) {?><?php echo $_smarty_tpl->getSubTemplate ("header.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>

<body>

<div class="navBar">
	<a class="left" href="http://kf.aqrcm.com/chat?locale=zh-cn&name=6kKf6aoo00oq5rap6hipMzY1Y3B4WQO0O0OO0O0O"><i class="service"></i></a>
	<div class="titleView">商富商城</div>
	<a class="right" href="?tpl=search"><i class="search"></i></a>
</div>

<div class="home-index main-padding-top main-padding-bottom">
	<div class="pullRefresh">
		<?php if (count($_smarty_tpl->tpl_vars['data']->value['flashes'])>0) {?>
		<div class="pageView">
			<div class="slide">
				<ul>
					<?php  $_smarty_tpl->tpl_vars['g'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['g']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['data']->value['flashes']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['g']->key => $_smarty_tpl->tpl_vars['g']->value) {
$_smarty_tpl->tpl_vars['g']->_loop = true;
?>
					<li ad_type="<?php echo $_smarty_tpl->tpl_vars['g']->value->ad_type;?>
" ad_content="<?php echo $_smarty_tpl->tpl_vars['g']->value->ad_content;?>
" pic="<?php echo $_smarty_tpl->tpl_vars['g']->value->pic;?>
"></li>
					<?php } ?>
				</ul>
			</div>
			<div class="pager"></div>
		</div>
		<?php }?>
		
		<div class="cate">
			<a href="wap.php?app=goods&act=index&ext_property=5"><div class="ico1"></div><span>疯狂折扣</span></a>
			<a href="wap.php?app=goods&act=index&ext_property=2"><div class="ico3"></div><span>热卖榜</span></a>
			<?php if (count($_smarty_tpl->tpl_vars['data']->value['icons'])>0) {?>
				<?php  $_smarty_tpl->tpl_vars['icon'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['icon']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['data']->value['icons']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['icon']->key => $_smarty_tpl->tpl_vars['icon']->value) {
$_smarty_tpl->tpl_vars['icon']->_loop = true;
?>
				<a href="wap.php?app=goods&act=index&integral=1&category_id=<?php echo $_smarty_tpl->tpl_vars['icon']->value->id;?>
"><div class="ico2" style="background-image:url(<?php echo $_smarty_tpl->tpl_vars['icon']->value->home_icon;?>
);"></div><span><?php echo $_smarty_tpl->tpl_vars['icon']->value->home_name;?>
</span></a>
				<?php } ?>
			<?php }?>
			
		</div>
		
		<div class="tip ge-top"><i></i>优选精品</div>
		<?php if (count($_smarty_tpl->tpl_vars['data']->value['yxjp'])>0) {?>
		<ul class="list ads">
			<?php  $_smarty_tpl->tpl_vars['g'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['g']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['data']->value['yxjp']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['g']->key => $_smarty_tpl->tpl_vars['g']->value) {
$_smarty_tpl->tpl_vars['g']->_loop = true;
?>
			<li ad_type="<?php echo $_smarty_tpl->tpl_vars['g']->value->ad_type;?>
" ad_content="<?php echo $_smarty_tpl->tpl_vars['g']->value->ad_content;?>
" pic="<?php echo $_smarty_tpl->tpl_vars['g']->value->pic;?>
"></li>
			<?php } ?>
		</ul>
		<?php }?>
	</div>
</div>

<div class="footer">
	<a class="ico1 this" href="wap.php"></a>
	<a class="ico2" href="wap.php?app=category&act=index"></a>
	<a class="ico5" href="wap.php?app=member&act=index"></a>
</div>

<script>
var offset = $('.pullRefresh .list > li').length;
function createHtml(g){
	var html = '<li ad_type="'+g.ad_type+'" ad_content="'+g.ad_content+'" pic="'+g.pic+'"></li>';
	offset++;
	return html;
}
function resize(){
	$('.pageView').autoHeight(320, 137);
	$('.pageView li').css({ width:$('.pageView').width(), height:$('.pageView').height() });
	$('.pageView').touchmove({
		pager : '.pager',
		drag : true,
		auto : 4000,
		autoWait : 4000,
		complete : function(){
			$('.pager').css('margin-left', -$('.pager').width()/2);
			setAds('.pageView .slide li');
		}
	});
	$('.ads li').autoHeight(320, 103);
}
$(window).resize(resize);
$(function(){
	resize();
	setAds('.pageView .slide li, .home-index .ads li');
	$('.home-index').height($.window().height-$('.home-index').padding().top-$('.home-index').padding().bottom);
	$('.pullRefresh').pullRefresh({
		header : true,
		footer : true,
		footerNoMoreText : '- END -',
		refresh : function(fn){
			var _this = this;
			offset = 0;
			$.getJSON('api.php?app=home&act=index', function(json){
				if(json.error!=0){ $.overloadError(json.msg);return }
				var html = '';
				if($.isArray(json.data.yxjp))for(var i=0; i<json.data.yxjp.length; i++)html += createHtml(json.data.yxjp[i]);
				_this.find('.list').html(html);
				setAds('.list li');
				fn();
			});
		},
		load : function(fn){
			var _this = this;
			$.getJSON('api.php?app=home&act=index', { offset:offset }, function(json){
				if(json.error!=0){ $.overloadError(json.msg);return }
				var html = '';
				if($.isArray(json.data.yxjp))for(var i=0; i<json.data.yxjp.length; i++)html += createHtml(json.data.yxjp[i]);
				_this.find('.list').append(html);
				setAds('.list li');
				fn();
			});
		}
	});
});
</script>
<?php echo $_smarty_tpl->getSubTemplate ("footer.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>

<?php }} ?>
